/*
 explain：接收用户输入的n*n的矩阵，旋转90度后输出。
 */
package com.yuan.algorithms.Algorithm_1;

import java.util.Scanner;

public class 旋转90度输出矩阵 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            char[][] arr = new char[n][n];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    arr[i][j] = sc.next().charAt(0);
                }
            }
            for (int i = 0; i < n; i++) {
                for (int j = n - 1; j >= 0; j--) {
                    if (j == 0) {
                        System.out.println(arr[j][i]);
                    } else {
                        System.out.print(arr[j][i] + " ");
                    }
                }
            }
        }
    }

}
